package dome1;

public class text {
    public static void func(Animal animal){
        animal.eat();
    }

    public static void main(String[] args){
        Dog dog=new Dog("旺财",2);
        func(dog);
        Cat cat=new Cat("小猫",3);
        func(cat);
    }
}
